package Test.Exam;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @ClassName Test02
 * @since: 2024/4/9 19:11
 * @auth: kirito
 * @description:
 **/
public class Test02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        int[][] arr = new int[t][2];
        int f = 0;
        for (int i = 0; i < t; ) {
            int i1 = in.nextInt();
            arr[i][f] = i1 ;
            if (f == 0) {
                f = 1;
            }else {
                f = 0;
                i++;
            }
        }
//        for (int i = 0; i < t; i++) {
//            System.out.print(arr[i][0] + "   " + arr[i][1]);
//            System.out.println();
//        }
        for (int i = 0; i < t; i++) {
            BigDecimal bigDecimal = new BigDecimal(360);
            BigDecimal x = new BigDecimal(arr[i][1]);

            BigDecimal res = x.divide(bigDecimal, 6, RoundingMode.HALF_UP);
            System.out.println(res);

        }
    }
}
